<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr1 = ['a','b','c'];
        var re1 = arr1.forEach(function(item,index,arr){
            // item表示被遍历数组的每一项
            // index表示被遍历数组的每一项所对应的索引
            // arr表示被遍历的数组
            console.log(item,index,arr);
            console.log(re1,'==')
            return item;
        })
        // 过滤出满足条件的元素
            var arr2 = [1,2,3,4];
            var re2 = arr2.filter(function(item,index,arr){
            return item > 2;
        })
        console.log(re2,'fillter');

        var arr3 = [1,2,3,4];
        // 将数组换一种形式显示
            var re3 = arr3.map(function(item,index,arr){
            return item > 2;
        })
        console.log(re3,'map');
    </script>
</body>
</html>